#include <stdio.h>
int Length(char p[])//1
{	 	 		 	  	   
    int n = 0;
	int i = 0;    
    while (p[i] != '\0')//2
    {	 	 		 	  	   
        n++;//1
        i++;//1
    }
    return n;
}	 	 		 	  	   
 
int IsAllDigit(char p[])//1
{	 	 		 	  	   
    int flag = 1;//1
	int i = 0;
    while (p[i] != '\0')//2
    {	 	 		 	  	   
        if (p[i] >= '0' &&  p[i] <= '9')//2
        {	 	 		 	  	   
			i++;//1
		}
        else
        {	 	 		 	  	   
            flag = 0;//1
            break;//1
        }
    }
    return flag;//1
}	 	 		 	  	   
 
int main()
{	 	 		 	  	   
    int len, dig;
    char str[20];
    printf("Please input a string:");
    scanf("%s", str);//1
    len = Length(str);//1
    printf("The string has %d characters.\n", len);
    dig = IsAllDigit(str);//1
    if (dig == 1)//1
        printf("The string is a digit string.\n");
    else
        printf("The string is not a digit string.\n");
    return 0;
}	 